import fetch from 'common/src/utils/fetch'
import UTILS from "common/src/utils/utils";
/**
 * 查询参军学生列表
 * params {data: {}} 查询条件
 */
function querytableData(data) {
    return fetch({
        url: '/api/scoremanagementservice/militaryStudentController/queryMilitaryStudentScoreList',
        method: 'post',
        data
    });
}
/**
 * 查询导入窗口中参军学生列表数据
 * @param {*} data 
 */
function queryselectTableData(calendarId) {
    return fetch({
        url: `/api/scoremanagementservice/militaryStudentController/queryMilitaryStudentList?calendarId=${calendarId}`,
        method: 'get',
    });
}
/**
 * 导入已选择的学生列表
 * @param {*} data 
 */
function saveData(calendarId, data) {
    return fetch({
        url: '/api/scoremanagementservice/militaryStudentController/importMilitaryStudentScore',
        method: 'post',
        data
    })
}
/**
 * 导出参军学生信息
 * @param {*} data 
 */
function exportList(data) {
    return fetch({
        url: '/api/scoremanagementservice/militaryStudentController/exportMilitaryStudentScoreList?language=cn',
        method: 'post',
        responseType: 'blob',
        data
    }).then(res => {
        UTILS.downloadFile(res, '参军学生成绩列表.xlsx', 'application/vnd.ms-excel;charset=utf-8');
    })
}
export default{
    querytableData,
    queryselectTableData,
    saveData,
    exportList
}